package cn.cxq.learning.double_linked_list;


public class Client {

    public static void main(String[] args) {
        DoubleLinkedList doubleLinkedList = new DoubleLinkedList();
        DoubleLinkedList doubleLinkedList2 = new DoubleLinkedList();

        Node node1 = new Node(1,"我");
        Node node2 = new Node(2,"是");
        Node node3 = new Node(3,"你");
        Node node4 = new Node(4,"爸爸");

        doubleLinkedList.add(node1);
        doubleLinkedList.add(node2);
        doubleLinkedList.add(node3);
        doubleLinkedList.add(node4);

        doubleLinkedList.list();
        doubleLinkedList.reverseList();
        System.out.println("-----------------------------------------------------");

        doubleLinkedList2.addByOrder(node1);
        doubleLinkedList2.addByOrder(node4);
        doubleLinkedList2.addByOrder(node4);
        doubleLinkedList2.addByOrder(node3);
        doubleLinkedList2.addByOrder(node2);

        doubleLinkedList2.list();
        doubleLinkedList2.reverseList();
        System.out.println("-----------------------------------------------------");

        Node node5 = new Node(4,"爷爷");
        doubleLinkedList.update(node5);

        doubleLinkedList.list();
        doubleLinkedList.reverseList();
        System.out.println("-----------------------------------------------------");

        doubleLinkedList.delete(3);

        doubleLinkedList.list();
        doubleLinkedList.reverseList();
    }
}
